home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch2d < prev    next >
Encoding:
Internet Message Format  |  1989-08-19  |  56.6 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i009:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch2d
  5. Message-ID: <4461@tekred.CNA.TEK.COM>
  6. Date: 18 Aug 89 15:49:24 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2107
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 9
  13. Archive-name: NetHack3/Patch2d
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 4 (of 7)."
  25. # Contents:  patch02d
  26. # Wrapped by billr@saab on Fri Aug 18 08:43:06 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patch02d' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patch02d'\"
  30. else
  31. echo shar: Extracting \"'patch02d'\" \(54146 characters\)
  32. sed "s/^X//" >'patch02d' <<'END_OF_FILE'
  33. X*** src/Old/mail.c    Wed Aug 16 12:23:56 1989
  34. X--- src/mail.c    Tue Aug 15 22:04:27 1989
  35. X***************
  36. X*** 56,65 ****
  37. X  static char *mailbox;
  38. X  static long laststattime;
  39. X  
  40. X  void
  41. X  getmailstatus() {
  42. X!     if(!(mailbox = getenv("MAIL")))
  43. X          return;
  44. X      if(stat(mailbox, &omstat)){
  45. X  #  ifdef PERMANENT_MAILBOX
  46. X          pline("Cannot get status of MAIL=%s .", mailbox);
  47. X--- 56,79 ----
  48. X  static char *mailbox;
  49. X  static long laststattime;
  50. X  
  51. X+ #  ifdef BSD
  52. X+ #   define MAILPATH "/usr/spool/mail/"
  53. X+ #  endif
  54. X+ #  ifdef SYSV
  55. X+ #   define MAILPATH "/usr/mail/"
  56. X+ #  endif
  57. X+ 
  58. X  void
  59. X  getmailstatus() {
  60. X!     if(!(mailbox = getenv("MAIL"))) {
  61. X! #  ifdef MAILPATH
  62. X!         mailbox = (char *) alloc(sizeof(MAILPATH)+8);
  63. X!         Strcpy(mailbox, MAILPATH);
  64. X!         Strcat(mailbox, getlogin());
  65. X! #  else
  66. X          return;
  67. X+ #  endif
  68. X+     }
  69. X      if(stat(mailbox, &omstat)){
  70. X  #  ifdef PERMANENT_MAILBOX
  71. X          pline("Cannot get status of MAIL=%s .", mailbox);
  72. X*** src/Old/makemon.c    Thu Aug  3 08:44:40 1989
  73. X--- src/makemon.c    Fri Aug 18 08:13:40 1989
  74. X***************
  75. X*** 7,13 ****
  76. X  struct monst zeromonst;
  77. X  static int uncommon P((struct permonst *));
  78. X  
  79. X! static int monstr[NUMMONS];
  80. X  
  81. X  #define m_initsgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 3)
  82. X  #define m_initlgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 10)
  83. X--- 7,13 ----
  84. X  struct monst zeromonst;
  85. X  static int uncommon P((struct permonst *));
  86. X  
  87. X! int monstr[NUMMONS];
  88. X  
  89. X  #define m_initsgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 3)
  90. X  #define m_initlgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 10)
  91. X***************
  92. X*** 116,121 ****
  93. X--- 116,124 ----
  94. X              case 1:
  95. X                  (void)mongets(mtmp, ELVEN_DAGGER);
  96. X                  break;
  97. X+             case 2:
  98. X+                 (void)mongets(mtmp, SLING);
  99. X+                 break;
  100. X                }
  101. X              if (!rn2(10)) (void)mongets(mtmp, ELVEN_MITHRIL_COAT);
  102. X          } else if (is_dwarf(ptr)) {
  103. X***************
  104. X*** 541,547 ****
  105. X      } else {
  106. X          if(x == u.ux && y == u.uy && ptr->mlet != S_GHOST) {
  107. X              mnexto(mtmp);
  108. X!             if (ptr->mlet == S_MIMIC) set_mimic_sym(mtmp);
  109. X          }
  110. X      }
  111. X  #ifdef HARD
  112. X--- 544,554 ----
  113. X      } else {
  114. X          if(x == u.ux && y == u.uy && ptr->mlet != S_GHOST) {
  115. X              mnexto(mtmp);
  116. X!             if (ptr->mlet == S_MIMIC) {
  117. X!                 set_mimic_sym(mtmp);
  118. X!                 unpmon(mtmp);
  119. X!                 pmon(mtmp);
  120. X!             }
  121. X          }
  122. X      }
  123. X  #ifdef HARD
  124. X***************
  125. X*** 1092,1103 ****
  126. X          sym = ALTAR_SYM;
  127. X  #endif
  128. X      /* We won't bother with beehives, morgues, barracks, throne rooms
  129. X!      * since they shouldn't contain mimics anyway...
  130. X       */
  131. X      else if (rt >= SHOPBASE) {
  132. X          int s_sym = get_shop_item(rt - SHOPBASE);
  133. X  
  134. X!         if (s_sym < 0) sym = objects[-sym].oc_olet;
  135. X          else if (s_sym == RANDOM_SYM)
  136. X              sym = syms[rn2(sizeof(syms)-2) + 2];
  137. X          else sym = s_sym;
  138. X--- 1099,1110 ----
  139. X          sym = ALTAR_SYM;
  140. X  #endif
  141. X      /* We won't bother with beehives, morgues, barracks, throne rooms
  142. X!      * since they shouldn't contain too many mimics anyway...
  143. X       */
  144. X      else if (rt >= SHOPBASE) {
  145. X          int s_sym = get_shop_item(rt - SHOPBASE);
  146. X  
  147. X!         if (s_sym < 0) sym = objects[-s_sym].oc_olet;
  148. X          else if (s_sym == RANDOM_SYM)
  149. X              sym = syms[rn2(sizeof(syms)-2) + 2];
  150. X          else sym = s_sym;
  151. X*** src/Old/end.c    Wed Aug 16 12:17:44 1989
  152. X--- src/end.c    Tue Aug 15 20:36:34 1989
  153. X***************
  154. X*** 13,18 ****
  155. X--- 13,30 ----
  156. X  
  157. X  void end_box_display();
  158. X  
  159. X+ static const char *deaths[] = {     /* the array of death */
  160. X+     "died", "choked", "poisoned", "starvation", "drowning",
  161. X+     "burning", "crushed", "turned to stone", "genocided",
  162. X+     "panic", "trickery",
  163. X+     "quit", "escaped", "ascended" };
  164. X+ 
  165. X+ static const char *ends[] = {        /* "when you..." */
  166. X+     "died", "choked", "were poisoned", "starved", "drowned",
  167. X+     "burned", "were crushed", "turned to stone", "were genocided",
  168. X+     "panicked", "were tricked",
  169. X+     "quit", "escaped", "ascended" };
  170. X+ 
  171. X  int
  172. X  done1()
  173. X  {
  174. X***************
  175. X*** 60,66 ****
  176. X      }
  177. X  #endif
  178. X  #ifndef LINT
  179. X!     done("quit");
  180. X  #endif
  181. X      return 0;
  182. X  }
  183. X--- 72,78 ----
  184. X      }
  185. X  #endif
  186. X  #ifndef LINT
  187. X!     done(QUIT);
  188. X  #endif
  189. X      return 0;
  190. X  }
  191. X***************
  192. X*** 97,118 ****
  193. X  
  194. X      You("die...");
  195. X      buf[0] = '\0';
  196. X      if (mtmp->minvis)
  197. X!         Sprintf(eos(buf), "invisible ");
  198. X      if (Hallucination)
  199. X!         Sprintf(eos(buf), "hallucinogen-distorted ");
  200. X  
  201. X      if(mtmp->data->mlet == S_GHOST) {
  202. X          register char *gn = (char *) mtmp->mextra;
  203. X          if (!Hallucination && !mtmp->minvis && *gn)
  204. X!             Sprintf(eos(buf), "the ");
  205. X          Sprintf(eos(buf), (*gn ? "ghost of %s" : "ghost%s"), gn);
  206. X      } else if(mtmp->isshk) {
  207. X          Sprintf(eos(buf), "%s %s, the shopkeeper",
  208. X              (ESHK(mtmp)->ismale ? "Mr." : "Ms."), shkname(mtmp));
  209. X!     } else if (mtmp->iswiz)
  210. X!         Sprintf(eos(buf), "the %s", mons[PM_WIZARD_OF_YENDOR].mname);
  211. X!     else Sprintf(eos(buf), "%s", mtmp->data->mname);
  212. X      if (mtmp->mnamelth) Sprintf(eos(buf), " called %s", NAME(mtmp));
  213. X      killer = buf;
  214. X      if (mtmp->data->mlet == S_WRAITH)
  215. X--- 109,130 ----
  216. X  
  217. X      You("die...");
  218. X      buf[0] = '\0';
  219. X+     if (mtmp->iswiz)
  220. X+         Strcat(buf, "the ");
  221. X      if (mtmp->minvis)
  222. X!         Strcat(buf, "invisible ");
  223. X      if (Hallucination)
  224. X!         Strcat(buf, "hallucinogen-distorted ");
  225. X  
  226. X      if(mtmp->data->mlet == S_GHOST) {
  227. X          register char *gn = (char *) mtmp->mextra;
  228. X          if (!Hallucination && !mtmp->minvis && *gn)
  229. X!             Strcat(buf, "the ");
  230. X          Sprintf(eos(buf), (*gn ? "ghost of %s" : "ghost%s"), gn);
  231. X      } else if(mtmp->isshk) {
  232. X          Sprintf(eos(buf), "%s %s, the shopkeeper",
  233. X              (ESHK(mtmp)->ismale ? "Mr." : "Ms."), shkname(mtmp));
  234. X!     } else Strcat(buf, mtmp->data->mname);
  235. X      if (mtmp->mnamelth) Sprintf(eos(buf), " called %s", NAME(mtmp));
  236. X      killer = buf;
  237. X      if (mtmp->data->mlet == S_WRAITH)
  238. X***************
  239. X*** 125,133 ****
  240. X      if (u.ugrave_arise > -1 && (mons[u.ugrave_arise].geno & G_GENOD))
  241. X          u.ugrave_arise = -1;
  242. X      if (mtmp->data->mlet == S_COCKATRICE)
  243. X!         done("stoned");
  244. X      else
  245. X!         done("died");
  246. X      return;
  247. X  }
  248. X  
  249. X--- 137,145 ----
  250. X      if (u.ugrave_arise > -1 && (mons[u.ugrave_arise].geno & G_GENOD))
  251. X          u.ugrave_arise = -1;
  252. X      if (mtmp->data->mlet == S_COCKATRICE)
  253. X!         done(STONING);
  254. X      else
  255. X!         done(DIED);
  256. X      return;
  257. X  }
  258. X  
  259. X***************
  260. X*** 170,189 ****
  261. X              abort();    /* generate core dump */
  262. X  # endif
  263. X  #endif
  264. X!     done("panicked");
  265. X  }
  266. X  
  267. X- /* called with arg "died", "drowned", "escaped", "quit", "choked", "panicked",
  268. X-    "burned", "starved", "stoned", or "tricked" */
  269. X  /* Be careful not to call panic from here! */
  270. X  void
  271. X! done(st1)
  272. X! register char *st1;
  273. X  {
  274. X      struct permonst *upmon;
  275. X!     char buf[BUFSZ], buf1[BUFSZ], buf2[BUFSZ], buf3[BUFSZ];
  276. X      /* buf: used if killer gets changed
  277. X-      * buf1: used if st1 gets changed
  278. X       * buf2: same as player name, except it is capitalized
  279. X       * buf3: used to copy killer in case it comes from something like
  280. X          xname(), which would otherwise get overwritten when we call
  281. X--- 182,198 ----
  282. X              abort();    /* generate core dump */
  283. X  # endif
  284. X  #endif
  285. X!     done(PANICKED);
  286. X  }
  287. X  
  288. X  /* Be careful not to call panic from here! */
  289. X  void
  290. X! done(how)
  291. X! int how;
  292. X  {
  293. X      struct permonst *upmon;
  294. X!     char buf[BUFSZ], buf2[BUFSZ], buf3[BUFSZ];
  295. X      /* buf: used if killer gets changed
  296. X       * buf2: same as player name, except it is capitalized
  297. X       * buf3: used to copy killer in case it comes from something like
  298. X          xname(), which would otherwise get overwritten when we call
  299. X***************
  300. X*** 192,206 ****
  301. X      char    c;
  302. X      boolean taken;
  303. X  
  304. X!     Strcpy(buf3, killer);
  305. X      killer = buf3;
  306. X  #ifdef WIZARD
  307. X!     if (wizard && *st1=='t') {
  308. X          You("are a very tricky wizard, it seems.");
  309. X          return;
  310. X      }
  311. X  #endif
  312. X!     if(Lifesaved && index("bcds", *st1)){
  313. X          u.uswldtim = 0;
  314. X          if(u.uhpmax < 0) u.uhpmax = 10;    /* arbitrary */
  315. X          u.uhp = u.uhpmax;
  316. X--- 201,215 ----
  317. X      char    c;
  318. X      boolean taken;
  319. X  
  320. X!     Strcpy(buf3, (!killer || how >= PANICKED ? deaths[how] : killer));
  321. X      killer = buf3;
  322. X  #ifdef WIZARD
  323. X!     if (wizard && how == TRICKED) {
  324. X          You("are a very tricky wizard, it seems.");
  325. X          return;
  326. X      }
  327. X  #endif
  328. X!     if(Lifesaved && how <= GENOCIDED) {
  329. X          u.uswldtim = 0;
  330. X          if(u.uhpmax < 0) u.uhpmax = 10;    /* arbitrary */
  331. X          u.uhp = u.uhpmax;
  332. X***************
  333. X*** 212,218 ****
  334. X          You("feel much better!");
  335. X          pline("The medallion crumbles to dust!");
  336. X          useup(uamul);
  337. X-         Lifesaved = 0;
  338. X          if (u.uhunger < 500) u.uhunger = 500;
  339. X          nomovemsg = "You survived that attempt on your life.";
  340. X          curs_on_u();
  341. X--- 221,226 ----
  342. X***************
  343. X*** 220,233 ****
  344. X          if(multi > 0) multi = 0; else multi = -1;
  345. X          flags.botl = 1;
  346. X          u.ugrave_arise = -1;
  347. X!         if (!strncmp(killer, "genocide", 8)) {
  348. X              pline("Unfortunately you are still genocided...");
  349. X!             done("died");
  350. X          }
  351. X-         return;
  352. X      }
  353. X  #if defined(WIZARD) || defined(EXPLORE_MODE)
  354. X!     if((wizard || discover) && index("bcds", *st1)){
  355. X          pline("Die? ");
  356. X          if(yn() == 'y') goto die;
  357. X          u.uswldtim = 0;
  358. X--- 228,242 ----
  359. X          if(multi > 0) multi = 0; else multi = -1;
  360. X          flags.botl = 1;
  361. X          u.ugrave_arise = -1;
  362. X!         if (how == GENOCIDED)
  363. X              pline("Unfortunately you are still genocided...");
  364. X!         else {
  365. X!             killer = 0;
  366. X!             return;
  367. X          }
  368. X      }
  369. X  #if defined(WIZARD) || defined(EXPLORE_MODE)
  370. X!     if((wizard || discover) && how <= GENOCIDED) {
  371. X          pline("Die? ");
  372. X          if(yn() == 'y') goto die;
  373. X          u.uswldtim = 0;
  374. X***************
  375. X*** 241,246 ****
  376. X--- 250,256 ----
  377. X          if(multi > 0) multi = 0; else multi = -1;
  378. X          flags.botl = 1;
  379. X          u.ugrave_arise = -1;
  380. X+         killer = 0;
  381. X          return;
  382. X      }
  383. X  #endif /* WIZARD || EXPLORE_MODE */
  384. X***************
  385. X*** 254,274 ****
  386. X  #endif /* NO_SIGNAL /* */
  387. X      upmon = player_mon();
  388. X      if(u.ugrave_arise > -1) /* create no corpse */ ;
  389. X!     else if(*st1 == 's' && st1[2] == 'o') 
  390. X          (mk_named_object(STATUE, upmon, u.ux, u.uy, plname,
  391. X                      strlen(plname)))->spe = 0;
  392. X      else
  393. X          (void) mk_named_object(CORPSE, upmon, u.ux, u.uy, plname,
  394. X                              strlen(plname));
  395. X!     if(*st1 == 'q' && u.uhp < 1){
  396. X!         st1 = "died";
  397. X!         killer = "quit while already on Charon's boat";
  398. X      }
  399. X-     if(*st1 == 's' && st1[2] == 'a') killer = "starvation"; else
  400. X-     if(*st1 == 'd' && st1[1] == 'r') killer = "drowning"; else
  401. X-     if(*st1 == 'p') killer = "panic"; else
  402. X-     if(*st1 == 't') killer = "trickery"; else
  403. X-     if(!index("bcds", *st1)) killer = st1;
  404. X      taken = paybill();
  405. X      paygd();
  406. X      clearlocks();
  407. X--- 264,281 ----
  408. X  #endif /* NO_SIGNAL /* */
  409. X      upmon = player_mon();
  410. X      if(u.ugrave_arise > -1) /* create no corpse */ ;
  411. X!     else if(how == STONED)
  412. X          (mk_named_object(STATUE, upmon, u.ux, u.uy, plname,
  413. X                      strlen(plname)))->spe = 0;
  414. X      else
  415. X          (void) mk_named_object(CORPSE, upmon, u.ux, u.uy, plname,
  416. X                              strlen(plname));
  417. X! 
  418. X!     if(how == QUIT && u.uhp < 1) {
  419. X!         how = DIED;
  420. X!         Strcpy(buf, "quit while already on Charon's boat");
  421. X!         killer = buf;
  422. X      }
  423. X      taken = paybill();
  424. X      paygd();
  425. X      clearlocks();
  426. X***************
  427. X*** 277,283 ****
  428. X      if(invent) {
  429. X          if(taken)
  430. X          pline("Do you want to see what you had when you %s? ",
  431. X!             (*st1=='q') ? "quit" : "died");
  432. X          else
  433. X          pline("Do you want your possessions identified? ");
  434. X          /* New dump format by maartenj@cs.vu.nl */
  435. X--- 284,290 ----
  436. X      if(invent) {
  437. X          if(taken)
  438. X          pline("Do you want to see what you had when you %s? ",
  439. X!             (how == QUIT) ? "quit" : "died");
  440. X          else
  441. X          pline("Do you want your possessions identified? ");
  442. X          /* New dump format by maartenj@cs.vu.nl */
  443. X***************
  444. X*** 306,312 ****
  445. X          }
  446. X      }
  447. X  
  448. X!     if(index("bcds", *st1)){
  449. X  #ifdef WIZARD
  450. X          if(wizard) {
  451. X          pline("Save bones? ");
  452. X--- 313,319 ----
  453. X          }
  454. X      }
  455. X  
  456. X!     if(how < GENOCIDED) {
  457. X  #ifdef WIZARD
  458. X          if(wizard) {
  459. X          pline("Save bones? ");
  460. X***************
  461. X*** 316,330 ****
  462. X          savebones();
  463. X          if(!flags.notombstone) outrip();
  464. X      }
  465. X!     if(*st1 == 'c') killer = st1;        /* after outrip() */
  466. X!     if(*st1 == 's' && st1[2] == 'o') {
  467. X!         Sprintf(buf, "turned to stone by %s",killer);
  468. X          /* No a or an; topten.c will do that. */
  469. X          killer = buf;
  470. X-         st1 = "turned to stone";
  471. X      }
  472. X!     Strcpy(buf1, st1);
  473. X!     if(u.uhave_amulet) Strcat(killer," (with the Amulet)");
  474. X      settty(NULL);    /* does a clear_screen() */
  475. X      Strcpy(buf2, plname);
  476. X      if('a' <= buf2[0] && buf2[0] <= 'z') buf2[0] += 'A'-'a';
  477. X--- 323,335 ----
  478. X          savebones();
  479. X          if(!flags.notombstone) outrip();
  480. X      }
  481. X!     if(how == STONING) {
  482. X!         Strcpy(buf, "turned to stone by ");
  483. X!         Strcat(buf, killer);
  484. X          /* No a or an; topten.c will do that. */
  485. X          killer = buf;
  486. X      }
  487. X!     if(u.uhave_amulet) Strcat(killer, " (with the Amulet)");
  488. X      settty(NULL);    /* does a clear_screen() */
  489. X      Strcpy(buf2, plname);
  490. X      if('a' <= buf2[0] && buf2[0] <= 'z') buf2[0] += 'A'-'a';
  491. X***************
  492. X*** 331,337 ****
  493. X      if(!done_stopprint)
  494. X          Printf("Goodbye %s the %s...\n\n", buf2,
  495. X  #ifdef ENDGAME
  496. X!            *st1 != 'a' ? pl_character : "Demigod");
  497. X  #else
  498. X             pl_character);
  499. X  #endif
  500. X--- 336,342 ----
  501. X      if(!done_stopprint)
  502. X          Printf("Goodbye %s the %s...\n\n", buf2,
  503. X  #ifdef ENDGAME
  504. X!            how != ASCENDED ? pl_character : "Demigod");
  505. X  #else
  506. X             pl_character);
  507. X  #endif
  508. X***************
  509. X*** 339,345 ****
  510. X        tmp = u.ugold - u.ugold0;
  511. X        if(tmp < 0)
  512. X          tmp = 0;
  513. X!       if(*st1 == 'd' || *st1 == 'b')
  514. X          tmp -= tmp/10;
  515. X        u.urexp += tmp;
  516. X        u.urexp += 50 * maxdlevel;
  517. X--- 344,350 ----
  518. X        tmp = u.ugold - u.ugold0;
  519. X        if(tmp < 0)
  520. X          tmp = 0;
  521. X!       if(how < PANICKED)
  522. X          tmp -= tmp/10;
  523. X        u.urexp += tmp;
  524. X        u.urexp += 50 * maxdlevel;
  525. X***************
  526. X*** 346,361 ****
  527. X        if(maxdlevel > 20)
  528. X          u.urexp += 1000*((maxdlevel > 30) ? 10 : maxdlevel - 20);
  529. X  #ifdef ENDGAME
  530. X!       if(*st1 == 'a') u.urexp *= 2;
  531. X  #endif
  532. X      }
  533. X!     if(*st1 == 'e') {
  534. X          register struct monst *mtmp;
  535. X          register struct obj *otmp;
  536. X          long i;
  537. X          register unsigned int worthlessct = 0;
  538. X  
  539. X-         killer = st1;
  540. X          keepdogs();
  541. X          mtmp = mydogs;
  542. X          if(mtmp) {
  543. X--- 351,365 ----
  544. X        if(maxdlevel > 20)
  545. X          u.urexp += 1000*((maxdlevel > 30) ? 10 : maxdlevel - 20);
  546. X  #ifdef ENDGAME
  547. X!       if(how == ASCENDED) u.urexp *= 2;
  548. X  #endif
  549. X      }
  550. X!     if(how == ESCAPED) {
  551. X          register struct monst *mtmp;
  552. X          register struct obj *otmp;
  553. X          long i;
  554. X          register unsigned int worthlessct = 0;
  555. X  
  556. X          keepdogs();
  557. X          mtmp = mydogs;
  558. X          if(mtmp) {
  559. X***************
  560. X*** 400,413 ****
  561. X          if(worthlessct)
  562. X            Printf("        %u worthless piece%s of colored glass,\n",
  563. X              worthlessct, plur((long)worthlessct));
  564. X-         if(u.uhave_amulet) killer = "escaped (with Amulet)";
  565. X-         else killer = "escaped";
  566. X      } else
  567. X          if(!done_stopprint) {
  568. X!             Printf("You %s ", 
  569. X!             !strcmp(st1, "tricked") ? "were tricked" : st1);
  570. X  #ifdef ENDGAME
  571. X!             if (*st1 != 'a') {
  572. X              if(dlevel == ENDLEVEL)
  573. X                   Printf("in the endgame ");
  574. X                  else Printf("on dungeon level %d ", dlevel);
  575. X--- 404,414 ----
  576. X          if(worthlessct)
  577. X            Printf("        %u worthless piece%s of colored glass,\n",
  578. X              worthlessct, plur((long)worthlessct));
  579. X      } else
  580. X          if(!done_stopprint) {
  581. X!             Printf("You %s ", ends[how]);
  582. X  #ifdef ENDGAME
  583. X!             if (how != ASCENDED) {
  584. X              if(dlevel == ENDLEVEL)
  585. X                   Printf("in the endgame ");
  586. X                  else Printf("on dungeon level %d ", dlevel);
  587. X***************
  588. X*** 422,433 ****
  589. X          u.ugold, plur(u.ugold), moves, plur(moves));
  590. X      if(!done_stopprint)
  591. X    Printf("You were level %u with a maximum of %d hit points when you %s.\n",
  592. X!         u.ulevel, u.uhpmax, buf1);
  593. X!     if(*st1 == 'e' && !done_stopprint){
  594. X          getret();    /* all those pieces of coloured glass ... */
  595. X          cls();
  596. X      }
  597. X! #if defined(WIZARD) || defined(EXPLORE_MODE)
  598. X      if(wizard || discover)
  599. X          Printf("\nSince you were in %s mode, the score list \
  600. X  will not be checked.\n", wizard ? "wizard" : "discover");
  601. X--- 423,434 ----
  602. X          u.ugold, plur(u.ugold), moves, plur(moves));
  603. X      if(!done_stopprint)
  604. X    Printf("You were level %u with a maximum of %d hit points when you %s.\n",
  605. X!         u.ulevel, u.uhpmax, ends[how]);
  606. X!     if(how == ESCAPED && !done_stopprint){
  607. X          getret();    /* all those pieces of coloured glass ... */
  608. X          cls();
  609. X      }
  610. X! #if (defined(WIZARD) || defined(EXPLORE_MODE)) && !defined(LOGFILE)
  611. X      if(wizard || discover)
  612. X          Printf("\nSince you were in %s mode, the score list \
  613. X  will not be checked.\n", wizard ? "wizard" : "discover");
  614. X*** src/Old/lock.c    Wed Aug 16 12:23:18 1989
  615. X--- src/lock.c    Wed Aug 16 10:36:10 1989
  616. X***************
  617. X*** 142,147 ****
  618. X--- 142,150 ----
  619. X      return((xlock.usedtime = 0));
  620. X  }
  621. X  
  622. X+ void
  623. X+ reset_pick() { xlock.usedtime = 0; }
  624. X+ 
  625. X  int
  626. X  pick_lock(pick) /* pick a lock with a given object */
  627. X      register struct    obj    *pick;
  628. X***************
  629. X*** 184,190 ****
  630. X          if(levl[x][y].omask)
  631. X          for(otmp = fobj; otmp; otmp = otmp->nobj)
  632. X          if((otmp->ox == x) && (otmp->oy == y))
  633. X!             if(Is_box(otmp)) {
  634. X              pline("There is %s here, %s the lock? ",
  635. X              doname(otmp), (!otmp->olocked) ? "close" :
  636. X              ((picktyp == LOCK_PICK) ? "pick" : "open" ));
  637. X--- 187,195 ----
  638. X          if(levl[x][y].omask)
  639. X          for(otmp = fobj; otmp; otmp = otmp->nobj)
  640. X          if((otmp->ox == x) && (otmp->oy == y))
  641. X!             if(Is_box(otmp) &&
  642. X!                /* credit cards are only good for unlocking */
  643. X!                (picktyp != CREDIT_CARD || otmp->olocked)) {
  644. X              pline("There is %s here, %s the lock? ",
  645. X              doname(otmp), (!otmp->olocked) ? "close" :
  646. X              ((picktyp == LOCK_PICK) ? "pick" : "open" ));
  647. X***************
  648. X*** 232,238 ****
  649. X  #else
  650. X              mtmp->isshk)
  651. X  #endif
  652. X!             pline("\"No checks, no credit, no problem.\"");
  653. X          else
  654. X              kludge("I don't think %s would appreciate that.", mon_nam(mtmp));
  655. X          return(0);
  656. X--- 237,243 ----
  657. X  #else
  658. X              mtmp->isshk)
  659. X  #endif
  660. X!             verbalize("No checks, no credit, no problem.");
  661. X          else
  662. X              kludge("I don't think %s would appreciate that.", mon_nam(mtmp));
  663. X          return(0);
  664. X***************
  665. X*** 259,264 ****
  666. X--- 264,275 ----
  667. X              pline("This door is broken.");
  668. X              return(0);
  669. X          default:
  670. X+             /* credit cards are only good for unlocking */
  671. X+             if(picktyp == CREDIT_CARD && !(door->doormask & D_LOCKED)) {
  672. X+             You("can't lock a door with a credit card.");
  673. X+             return(0);
  674. X+             }
  675. X+ 
  676. X              pline("%sock it? ", (door->doormask & D_LOCKED) ? "Unl" : "L" );
  677. X  
  678. X              c = yn();
  679. X***************
  680. X*** 356,361 ****
  681. X--- 367,373 ----
  682. X  doopen() {        /* try to open a door */
  683. X      register int x, y;
  684. X      register struct rm *door;
  685. X+     struct monst *mtmp;
  686. X  
  687. X      if(!getdir(1)) return(0);
  688. X  
  689. X***************
  690. X*** 363,373 ****
  691. X      y = u.uy + u.dy;
  692. X      if((x == u.ux) && (y == u.uy)) return(0);
  693. X  
  694. X      door = &levl[x][y];
  695. X  
  696. X      if(!IS_DOOR(door->typ)) {
  697. X  #ifdef STRONGHOLD
  698. X!         if (is_drawbridge_wall(x,y) >= 0) {
  699. X              pline("There is no obvious way to open the drawbridge.");
  700. X              return(0);
  701. X          }
  702. X--- 375,392 ----
  703. X      y = u.uy + u.dy;
  704. X      if((x == u.ux) && (y == u.uy)) return(0);
  705. X  
  706. X+     if(levl[x][y].mmask && (mtmp = m_at(x,y))->mimic && 
  707. X+                 mtmp->mappearance == DOOR_SYM &&
  708. X+                 !Protection_from_shape_changers) {
  709. X+         stumble_onto_mimic(mtmp);
  710. X+         return(1);
  711. X+     }
  712. X+ 
  713. X      door = &levl[x][y];
  714. X  
  715. X      if(!IS_DOOR(door->typ)) {
  716. X  #ifdef STRONGHOLD
  717. X!         if (is_db_wall(x,y)) {
  718. X              pline("There is no obvious way to open the drawbridge.");
  719. X              return(0);
  720. X          }
  721. X***************
  722. X*** 431,436 ****
  723. X--- 450,456 ----
  724. X  doclose() {        /* try to close a door */
  725. X      register int x, y;
  726. X      register struct rm *door;
  727. X+     struct monst *mtmp;
  728. X  
  729. X      if(!getdir(1)) return(0);
  730. X  
  731. X***************
  732. X*** 440,445 ****
  733. X--- 460,473 ----
  734. X          You("are in the way!");
  735. X          return(1);
  736. X      }
  737. X+ 
  738. X+     if(levl[x][y].mmask && (mtmp = m_at(x,y))->mimic && 
  739. X+                 mtmp->mappearance == DOOR_SYM &&
  740. X+                 !Protection_from_shape_changers) {
  741. X+         stumble_onto_mimic(mtmp);
  742. X+         return(1);
  743. X+     }
  744. X+ 
  745. X      door = &levl[x][y];
  746. X  
  747. X      if(!IS_DOOR(door->typ)) {
  748. X***************
  749. X*** 592,597 ****
  750. X--- 620,649 ----
  751. X          if(door->doormask & D_LOCKED) {
  752. X              door->doormask = D_CLOSED | (door->doormask & D_TRAPPED);
  753. X              if(cansee(x,y)) pline("The door unlocks!");
  754. X+         } else res = 0;
  755. X+         break;
  756. X+         case WAN_STRIKING:
  757. X+ #ifdef SPELLS
  758. X+         case SPE_FORCE_BOLT:
  759. X+ #endif
  760. X+         if(door->doormask & (D_LOCKED | D_CLOSED)) {
  761. X+             if(door->doormask & D_TRAPPED) {
  762. X+             if (levl[x][y].mmask)
  763. X+                 (void) mb_trapped(m_at(x,y));
  764. X+             else if (flags.verbose)
  765. X+                 if (cansee(x,y))
  766. X+                    pline("KABOOM!!    You see a door explode.");
  767. X+                 else if (flags.soundok)
  768. X+                    You("hear a distant explosion.");
  769. X+             door->doormask = D_NODOOR;
  770. X+             break;
  771. X+             }
  772. X+             door->doormask = D_BROKEN;
  773. X+             if (flags.verbose)
  774. X+             if (cansee(x,y))
  775. X+                 pline("The door crashes open!");
  776. X+             else if (flags.soundok)
  777. X+                 You("hear a crashing sound.");
  778. X          } else res = 0;
  779. X          break;
  780. X          default:    impossible("magic (%d) attempted on door.", otmp->otyp);
  781. X*** src/Old/mcastu.c    Wed Aug 16 12:25:17 1989
  782. X--- src/mcastu.c    Tue Aug 15 22:58:26 1989
  783. X***************
  784. X*** 35,41 ****
  785. X  {
  786. X      int    dmg = 0, ml = mtmp->m_lev;
  787. X  
  788. X!     if(mtmp->mcan || mtmp->mspec_used) {  /* could not attack */
  789. X          cursetxt(mtmp);
  790. X          return(0);
  791. X      } else {
  792. X--- 35,41 ----
  793. X  {
  794. X      int    dmg = 0, ml = mtmp->m_lev;
  795. X  
  796. X!     if(mtmp->mcan || mtmp->mspec_used || !ml) {  /* could not attack */
  797. X          cursetxt(mtmp);
  798. X          return(0);
  799. X      } else {
  800. X***************
  801. X*** 105,111 ****
  802. X                  You("have an out of body experience.");
  803. X                  else  {
  804. X                  killer = "touch of death";
  805. X!                 done("died");
  806. X                  }
  807. X              } else {
  808. X                  if(Antimagic) shieldeff(u.ux, u.uy);
  809. X--- 105,111 ----
  810. X                  You("have an out of body experience.");
  811. X                  else  {
  812. X                  killer = "touch of death";
  813. X!                 done(DIED);
  814. X                  }
  815. X              } else {
  816. X                  if(Antimagic) shieldeff(u.ux, u.uy);
  817. X***************
  818. X*** 166,172 ****
  819. X              case 5:        /* make invisible if not */
  820. X              case 4:
  821. X              if(!mtmp->minvis) {
  822. X!                 if(canseemon(mtmp) && !See_invisible)
  823. X                  pline("%s suddenly disappears!",
  824. X                        Monnam(mtmp));
  825. X                  mtmp->minvis = 1;
  826. X--- 166,172 ----
  827. X              case 5:        /* make invisible if not */
  828. X              case 4:
  829. X              if(!mtmp->minvis) {
  830. X!                 if(canseemon(mtmp) && !See_invisible && !Telepat)
  831. X                  pline("%s suddenly disappears!",
  832. X                        Monnam(mtmp));
  833. X                  mtmp->minvis = 1;
  834. X*** src/Old/mhitm.c    Wed Aug 16 12:25:35 1989
  835. X--- src/mhitm.c    Wed Aug  9 19:21:58 1989
  836. X***************
  837. X*** 19,38 ****
  838. X  static int mdamagem P((struct monst *,struct monst *,struct attack *));
  839. X  static void mswingsm P((struct monst *, struct monst *, struct obj *));
  840. X  
  841. X- static boolean
  842. X- m_incompat(magr, mdef)
  843. X- /* This must work like in mhitu.c.  Specifically, if it's a shopkeeper
  844. X-  * polymorphed into a monster of a specific gender, the specific gender
  845. X-  * overrides.  Thus, do not use is_female(), since then a female shopkeeper
  846. X-  * polymorphed into an incubus, or any shopkeeper turned into something
  847. X-  * genderless, would be treated improperly.
  848. X-  * This nonsense could be avoided if every monster had a gender field...
  849. X-  */
  850. X- register struct monst *magr, *mdef;
  851. X- {
  852. X-     return(gender(magr) != 1-gender(mdef));
  853. X- }
  854. X- 
  855. X  static void
  856. X  noises(magr, mattk)
  857. X      register struct monst *magr;
  858. X--- 19,24 ----
  859. X***************
  860. X*** 60,70 ****
  861. X      if(vis) {
  862. X          if(mdef->mimic) seemimic(mdef);
  863. X          if(magr->mimic) seemimic(magr);
  864. X!         if (sp_melee(magr) && !magr->mcan &&
  865. X!                 (is_nymph(magr) || !m_incompat(magr,mdef))) {
  866. X              Sprintf(buf, "%s pretends to be friendly to",
  867. X                                  Monnam(magr));
  868. X!         } else
  869. X              Sprintf(buf,"%s misses", Monnam(magr));
  870. X          pline("%s %s.", buf, mon_nam(mdef));
  871. X      } else  noises(magr, mattk);
  872. X--- 46,55 ----
  873. X      if(vis) {
  874. X          if(mdef->mimic) seemimic(mdef);
  875. X          if(magr->mimic) seemimic(magr);
  876. X!         if (could_seduce(magr,mdef,mattk) && !magr->mcan)
  877. X              Sprintf(buf, "%s pretends to be friendly to",
  878. X                                  Monnam(magr));
  879. X!         else
  880. X              Sprintf(buf,"%s misses", Monnam(magr));
  881. X          pline("%s %s.", buf, mon_nam(mdef));
  882. X      } else  noises(magr, mattk);
  883. X***************
  884. X*** 195,215 ****
  885. X      register struct monst *magr,*mdef;
  886. X      struct    attack *mattk;
  887. X  {
  888. X- 
  889. X      if(vis){
  890. X          char buf[BUFSZ];
  891. X          if(mdef->mimic) seemimic(mdef);
  892. X          if(magr->mimic) seemimic(magr);
  893. X!         if(sp_melee(magr) && !magr->mcan) {
  894. X!             if(!is_nymph(magr) && m_incompat(magr,mdef))
  895. X!                 goto strike;
  896. X              Sprintf(buf, "%s %s", Monnam(magr),
  897. X                  mdef->mblinded ? "talks to" : "smiles at");
  898. X              pline("%s %s %s.", buf, mon_nam(mdef),
  899. X!                 m_incompat(magr,mdef) ?
  900. X                      "engagingly" : "seductively");
  901. X          } else {
  902. X-     strike:
  903. X              switch (mattk->aatyp) {
  904. X              case AT_BITE:
  905. X                  Sprintf(buf,"%s bites", Monnam(magr));
  906. X--- 180,198 ----
  907. X      register struct monst *magr,*mdef;
  908. X      struct    attack *mattk;
  909. X  {
  910. X      if(vis){
  911. X+         int compat;
  912. X          char buf[BUFSZ];
  913. X+ 
  914. X          if(mdef->mimic) seemimic(mdef);
  915. X          if(magr->mimic) seemimic(magr);
  916. X!         if((compat = could_seduce(magr,mdef,mattk)) && !magr->mcan) {
  917. X              Sprintf(buf, "%s %s", Monnam(magr),
  918. X                  mdef->mblinded ? "talks to" : "smiles at");
  919. X              pline("%s %s %s.", buf, mon_nam(mdef),
  920. X!                 compat == 2 ?
  921. X                      "engagingly" : "seductively");
  922. X          } else {
  923. X              switch (mattk->aatyp) {
  924. X              case AT_BITE:
  925. X                  Sprintf(buf,"%s bites", Monnam(magr));
  926. X***************
  927. X*** 282,287 ****
  928. X--- 265,273 ----
  929. X      if((tmp = mdamagem(magr, mdef, mattk)) == 2) {
  930. X          levl[mx][my].mmask = 0;
  931. X          levl[magr->mx][magr->my].mmask = 1;
  932. X+         /* if mdamagem left a corpse it erased magr's symbol */
  933. X+         unpmon(magr);
  934. X+         pmon(magr);
  935. X          return(2);    /* defender died */
  936. X      } else {        /* defender survived */
  937. X          if(cansee(mdef->mx, mdef->my))
  938. X***************
  939. X*** 317,323 ****
  940. X      if(dist2(magr->mx, magr->my, u.ux, u.uy) < 3)
  941. X          (void) mdamageu(magr, d((int)mattk->damn, (int)mattk->damd));
  942. X  
  943. X!     mondied(magr);
  944. X      return(2);
  945. X  }
  946. X  
  947. X--- 303,309 ----
  948. X      if(dist2(magr->mx, magr->my, u.ux, u.uy) < 3)
  949. X          (void) mdamageu(magr, d((int)mattk->damn, (int)mattk->damd));
  950. X  
  951. X!     mondead(magr);
  952. X      return(2);
  953. X  }
  954. X  
  955. X*** src/Old/uhitm.c    Wed Aug 16 12:47:32 1989
  956. X--- src/uhitm.c    Wed Aug 16 10:34:15 1989
  957. X***************
  958. X*** 87,110 ****
  959. X      }
  960. X  
  961. X      if(mtmp->mimic && !Protection_from_shape_changers) {
  962. X!         if(!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data,AD_STCK))
  963. X!             u.ustuck = mtmp;
  964. X!         if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == DOOR_SYM)
  965. X! #ifdef SPELLS
  966. X!         {
  967. X!             if (okdoor(u.ux+u.dx, u.uy+u.dy))
  968. X! #endif
  969. X!             pline("The door actually was %s.", defmonnam(mtmp));
  970. X! #ifdef SPELLS
  971. X!             else
  972. X!             pline("That spellbook was %s.", defmonnam(mtmp));
  973. X!         }
  974. X! #endif
  975. X!         else if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == GOLD_SYM)
  976. X!             pline("That gold was %s!", defmonnam(mtmp));
  977. X!         else
  978. X!             pline("Wait!  That's %s!", defmonnam(mtmp));
  979. X!         wakeup(mtmp);    /* clears mtmp->mimic */
  980. X          return(TRUE);
  981. X      }
  982. X  
  983. X--- 87,93 ----
  984. X      }
  985. X  
  986. X      if(mtmp->mimic && !Protection_from_shape_changers) {
  987. X!         stumble_onto_mimic(mtmp);
  988. X          return(TRUE);
  989. X      }
  990. X  
  991. X***************
  992. X*** 127,132 ****
  993. X--- 110,162 ----
  994. X      return(FALSE);
  995. X  }
  996. X  
  997. X+ schar
  998. X+ find_roll_to_hit(mtmp)
  999. X+ register struct monst *mtmp;
  1000. X+ {
  1001. X+     schar tmp;
  1002. X+     struct permonst *mdat = mtmp->data;
  1003. X+ 
  1004. X+ #ifdef POLYSELF
  1005. X+     tmp = Luck + mdat->ac + abon() +
  1006. X+              ((u.umonnum >= 0) ? uasmon->mlevel : u.ulevel);
  1007. X+ #else
  1008. X+     tmp = Luck + u.ulevel + mdat->ac + abon();
  1009. X+ #endif
  1010. X+ /*    it is unchivalrous to attack the defenseless or from behind */
  1011. X+     if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL &&
  1012. X+         (mtmp->mfroz || mtmp->msleep || mtmp->mflee) &&
  1013. X+         u.ualign > -10) adjalign(-1);
  1014. X+ 
  1015. X+ /*    Adjust vs. (and possibly modify) monster state.        */
  1016. X+ 
  1017. X+     if(mtmp->mstun) tmp += 2;
  1018. X+     if(mtmp->mflee) tmp += 2;
  1019. X+ 
  1020. X+     if(mtmp->msleep) {
  1021. X+         mtmp->msleep = 0;
  1022. X+         tmp += 2;
  1023. X+     }
  1024. X+     if(mtmp->mfroz) {
  1025. X+         tmp += 4;
  1026. X+         if(!rn2(10)) mtmp->mfroz = 0;
  1027. X+     }
  1028. X+     if (is_orc(mtmp->data) && pl_character[0]=='E') tmp++;
  1029. X+ 
  1030. X+ /*    with a lot of luggage, your agility diminishes */
  1031. X+     tmp -= (inv_weight() + 40)/20;
  1032. X+     if(u.utrap) tmp -= 3;
  1033. X+ #ifdef POLYSELF
  1034. X+ /*    Some monsters have a combination of weapon attacks and non-weapon
  1035. X+  *    attacks.  It is therefore wrong to add hitval to tmp; we must add it
  1036. X+  *    only for the specific attack (in hmonas()).
  1037. X+  */
  1038. X+     if(uwep && u.umonnum == -1) tmp += hitval(uwep, mdat);
  1039. X+ #else
  1040. X+     if(uwep) tmp += hitval(uwep, mdat);
  1041. X+ #endif
  1042. X+     return tmp;
  1043. X+ }
  1044. X  
  1045. X  /* try to attack; return FALSE if monster evaded */
  1046. X  /* u.dx and u.dy must be set */
  1047. X***************
  1048. X*** 188,233 ****
  1049. X              return(TRUE);
  1050. X          }
  1051. X      }
  1052. X-     tmp = Luck + mdat->ac + abon() +
  1053. X-              ((u.umonnum >= 0) ? uasmon->mlevel : u.ulevel);
  1054. X- #else
  1055. X-     tmp = Luck + u.ulevel + mdat->ac + abon();
  1056. X  #endif
  1057. X  
  1058. X! /*    it is unchivalrous to attack the defenseless or from behind */
  1059. X!     if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL &&
  1060. X!         (mtmp->mfroz || mtmp->msleep || mtmp->mflee) &&
  1061. X!         u.ualign > -10) adjalign(-1);
  1062. X! 
  1063. X! /*    Adjust vs. (and possibly modify) monster state.        */
  1064. X! 
  1065. X!     if(mtmp->mstun) tmp += 2;
  1066. X!     if(mtmp->mflee) tmp += 2;
  1067. X! 
  1068. X!     if(mtmp->msleep) {
  1069. X!         mtmp->msleep = 0;
  1070. X!         tmp += 2;
  1071. X!     }
  1072. X!     if(mtmp->mfroz) {
  1073. X!         tmp += 4;
  1074. X!         if(!rn2(10)) mtmp->mfroz = 0;
  1075. X!     }
  1076. X!     if (is_orc(mtmp->data) && pl_character[0]=='E') tmp++;
  1077. X! 
  1078. X! /*    with a lot of luggage, your agility diminishes */
  1079. X!     tmp -= (inv_weight() + 40)/20;
  1080. X!     if(u.utrap) tmp -= 3;
  1081. X! 
  1082. X! #ifdef POLYSELF
  1083. X!     if(u.umonnum >= 0) (void) hmonas(mtmp, tmp);
  1084. X!     else {
  1085. X! #endif
  1086. X!         if(uwep) tmp += hitval(uwep, mdat);
  1087. X!         (void) hitum(mtmp, tmp);
  1088. X  #ifdef POLYSELF
  1089. X!     }
  1090. X  #endif
  1091. X! 
  1092. X      return(TRUE);
  1093. X  }
  1094. X  
  1095. X--- 218,231 ----
  1096. X              return(TRUE);
  1097. X          }
  1098. X      }
  1099. X  #endif
  1100. X  
  1101. X!     tmp = find_roll_to_hit(mtmp);
  1102. X  #ifdef POLYSELF
  1103. X!     if (u.umonnum >= 0) (void) hmonas(mtmp, tmp);
  1104. X!     else
  1105. X  #endif
  1106. X!         (void) hitum(mtmp, tmp);
  1107. X      return(TRUE);
  1108. X  }
  1109. X  
  1110. X***************
  1111. X*** 246,252 ****
  1112. X      if(!mhit) {
  1113. X          if(!Blind && flags.verbose) You("miss %s.", mon_nam(mon));
  1114. X          else            You("miss it.");
  1115. X!         if(is_human(mon->data) && !(mon->msleep || mon->mfroz))
  1116. X          wakeup(mon);
  1117. X      } else {
  1118. X          /* we hit the monster; be careful: it might die! */
  1119. X--- 244,250 ----
  1120. X      if(!mhit) {
  1121. X          if(!Blind && flags.verbose) You("miss %s.", mon_nam(mon));
  1122. X          else            You("miss it.");
  1123. X!         if(!mon->msleep && !mon->mfroz)
  1124. X          wakeup(mon);
  1125. X      } else {
  1126. X          /* we hit the monster; be careful: it might die! */
  1127. X***************
  1128. X*** 289,295 ****
  1129. X      boolean mhit = !((tmp <= rnd(20)) && !u.uswallow);
  1130. X  
  1131. X      malive = known_hitum(mon, mhit);
  1132. X!     (void) passive(mon, mhit, malive);
  1133. X      return(malive);
  1134. X  }
  1135. X  
  1136. X--- 287,293 ----
  1137. X      boolean mhit = !((tmp <= rnd(20)) && !u.uswallow);
  1138. X  
  1139. X      malive = known_hitum(mon, mhit);
  1140. X!     (void) passive(mon, mhit, malive, FALSE);
  1141. X      return(malive);
  1142. X  }
  1143. X  
  1144. X***************
  1145. X*** 300,308 ****
  1146. X  register int thrown;
  1147. X  {
  1148. X      register int tmp;
  1149. X      boolean hittxt = FALSE, destroyed = FALSE;
  1150. X      boolean get_dmg_bonus = TRUE;
  1151. X!     boolean ispoisoned = FALSE, needpoismsg = FALSE;
  1152. X  
  1153. X      wakeup(mon);
  1154. X      if(!obj) {
  1155. X--- 298,325 ----
  1156. X  register int thrown;
  1157. X  {
  1158. X      register int tmp;
  1159. X+     /* Why all these booleans?  This stuff has to be done in the
  1160. X+      *      following order:
  1161. X+      * 1) Know what we're attacking with, and print special hittxt for
  1162. X+      *    unusual cases.
  1163. X+      * 2a) Know whether we did damage (depends on 1)
  1164. X+      * 2b) Know if it's poisoned (depends on 1)
  1165. X+      * 2c) Know whether we get a normal damage bonus or not (depends on 1)
  1166. X+      * 3a) Know what the value of the damage bonus is (depends on 2c)
  1167. X+      * 3b) Know how much poison damage was taken (depends on 2b) and if the
  1168. X+      *    poison instant-killed it
  1169. X+      * 4) Know if it was killed (requires knowing 3a, 3b) except by instant-
  1170. X+      *    kill poison
  1171. X+      * 5) Print hit message (depends on 1 and 4)
  1172. X+      * 6a) Print poison message (must be done after 5)
  1173. X+      * 6b) Rust weapon (must be done after 5)
  1174. X+      * 7) Possibly kill monster (must be done after 6a, 6b)
  1175. X+      * 8) Instant-kill from poison (can happen anywhere between 5 and 9)
  1176. X+      * 9) Hands not glowing (must be done after 7 and 8)
  1177. X+      */
  1178. X      boolean hittxt = FALSE, destroyed = FALSE;
  1179. X      boolean get_dmg_bonus = TRUE;
  1180. X!     boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE;
  1181. X  
  1182. X      wakeup(mon);
  1183. X      if(!obj) {
  1184. X***************
  1185. X*** 502,512 ****
  1186. X          needpoismsg = TRUE;
  1187. X          else if (rn2(10))
  1188. X          tmp += rnd(6);
  1189. X!         else {
  1190. X!         pline("The poison was deadly...");
  1191. X!         xkilled(mon,0);
  1192. X!         return FALSE;
  1193. X!         }
  1194. X      }
  1195. X      if(tmp < 1) tmp = 1;
  1196. X  
  1197. X--- 519,525 ----
  1198. X          needpoismsg = TRUE;
  1199. X          else if (rn2(10))
  1200. X          tmp += rnd(6);
  1201. X!         else poiskilled = TRUE;
  1202. X      }
  1203. X      if(tmp < 1) tmp = 1;
  1204. X  
  1205. X***************
  1206. X*** 545,551 ****
  1207. X      if (needpoismsg)
  1208. X          kludge("The poison doesn't seem to affect %s.", mon_nam(mon));
  1209. X  
  1210. X!     if (destroyed)
  1211. X          killed(mon);    /* takes care of messages */
  1212. X      else if(u.umconf && !thrown) {
  1213. X          if(!Blind) {
  1214. X--- 558,568 ----
  1215. X      if (needpoismsg)
  1216. X          kludge("The poison doesn't seem to affect %s.", mon_nam(mon));
  1217. X  
  1218. X!     if (poiskilled) {
  1219. X!         pline("The poison was deadly...");
  1220. X!         xkilled(mon, 0);
  1221. X!         return FALSE;
  1222. X!     } else if (destroyed)
  1223. X          killed(mon);    /* takes care of messages */
  1224. X      else if(u.umconf && !thrown) {
  1225. X          if(!Blind) {
  1226. X***************
  1227. X*** 579,585 ****
  1228. X  }
  1229. X  
  1230. X  #ifdef POLYSELF
  1231. X! static int
  1232. X  damageum(mdef, mattk)
  1233. X  register struct monst *mdef;
  1234. X  register struct attack *mattk;
  1235. X--- 596,603 ----
  1236. X  }
  1237. X  
  1238. X  #ifdef POLYSELF
  1239. X! 
  1240. X! int
  1241. X  damageum(mdef, mattk)
  1242. X  register struct monst *mdef;
  1243. X  register struct attack *mattk;
  1244. X***************
  1245. X*** 589,598 ****
  1246. X  
  1247. X      stoned = FALSE;
  1248. X      if (is_demon(uasmon) && !rn2(13) && !uwep
  1249. X! #ifdef HARD
  1250. X          && u.umonnum != PM_SUCCUBUS && u.umonnum != PM_INCUBUS
  1251. X          && u.umonnum != PM_BALROG
  1252. X! #endif
  1253. X          ) {
  1254. X          struct monst *dtmp;
  1255. X          pline("Some hell-p has arrived!");
  1256. X--- 607,616 ----
  1257. X  
  1258. X      stoned = FALSE;
  1259. X      if (is_demon(uasmon) && !rn2(13) && !uwep
  1260. X! # ifdef HARD
  1261. X          && u.umonnum != PM_SUCCUBUS && u.umonnum != PM_INCUBUS
  1262. X          && u.umonnum != PM_BALROG
  1263. X! # endif
  1264. X          ) {
  1265. X          struct monst *dtmp;
  1266. X          pline("Some hell-p has arrived!");
  1267. X***************
  1268. X*** 617,625 ****
  1269. X              if(thick_skinned(mdef->data)) tmp = 0;
  1270. X          break;
  1271. X          case AD_FIRE:
  1272. X! #ifdef GOLEMS
  1273. X          golemeffects(mdef, AD_FIRE, tmp);
  1274. X! #endif /* GOLEMS */
  1275. X          if(resists_fire(pd)) {
  1276. X              shieldeff(mdef->mx, mdef->my);
  1277. X              tmp = 0;
  1278. X--- 635,643 ----
  1279. X              if(thick_skinned(mdef->data)) tmp = 0;
  1280. X          break;
  1281. X          case AD_FIRE:
  1282. X! # ifdef GOLEMS
  1283. X          golemeffects(mdef, AD_FIRE, tmp);
  1284. X! # endif /* GOLEMS */
  1285. X          if(resists_fire(pd)) {
  1286. X              shieldeff(mdef->mx, mdef->my);
  1287. X              tmp = 0;
  1288. X***************
  1289. X*** 627,641 ****
  1290. X              if(!Blind) pline("%s is on fire!", Monnam(mdef));
  1291. X              tmp += destroy_mitem(mdef, SCROLL_SYM, AD_FIRE);
  1292. X              tmp += destroy_mitem(mdef, POTION_SYM, AD_FIRE);
  1293. X! #ifdef SPELLS
  1294. X              tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  1295. X! #endif
  1296. X          }
  1297. X          break;
  1298. X          case AD_COLD:
  1299. X! #ifdef GOLEMS
  1300. X          golemeffects(mdef, AD_COLD, tmp);
  1301. X! #endif /* GOLEMS */
  1302. X          if(resists_cold(pd)) {
  1303. X              shieldeff(mdef->mx, mdef->my);
  1304. X              tmp = 0;
  1305. X--- 645,659 ----
  1306. X              if(!Blind) pline("%s is on fire!", Monnam(mdef));
  1307. X              tmp += destroy_mitem(mdef, SCROLL_SYM, AD_FIRE);
  1308. X              tmp += destroy_mitem(mdef, POTION_SYM, AD_FIRE);
  1309. X! # ifdef SPELLS
  1310. X              tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  1311. X! # endif
  1312. X          }
  1313. X          break;
  1314. X          case AD_COLD:
  1315. X! # ifdef GOLEMS
  1316. X          golemeffects(mdef, AD_COLD, tmp);
  1317. X! # endif /* GOLEMS */
  1318. X          if(resists_cold(pd)) {
  1319. X              shieldeff(mdef->mx, mdef->my);
  1320. X              tmp = 0;
  1321. X***************
  1322. X*** 645,653 ****
  1323. X          }
  1324. X          break;
  1325. X          case AD_ELEC:
  1326. X! #ifdef GOLEMS
  1327. X          golemeffects(mdef, AD_ELEC, tmp);
  1328. X! #endif /* GOLEMS */
  1329. X          if(resists_elec(pd)) {
  1330. X              shieldeff(mdef->mx, mdef->my);
  1331. X              tmp = 0;
  1332. X--- 663,671 ----
  1333. X          }
  1334. X          break;
  1335. X          case AD_ELEC:
  1336. X! # ifdef GOLEMS
  1337. X          golemeffects(mdef, AD_ELEC, tmp);
  1338. X! # endif /* GOLEMS */
  1339. X          if(resists_elec(pd)) {
  1340. X              shieldeff(mdef->mx, mdef->my);
  1341. X              tmp = 0;
  1342. X***************
  1343. X*** 665,673 ****
  1344. X          }
  1345. X          tmp = 0;    /* no damage if this fails */
  1346. X          break;
  1347. X! #ifdef SEDUCE
  1348. X          case AD_SSEX:
  1349. X! #endif
  1350. X          case AD_SEDU:
  1351. X          case AD_SITM:
  1352. X          if(mdef->minvent) {
  1353. X--- 683,691 ----
  1354. X          }
  1355. X          tmp = 0;    /* no damage if this fails */
  1356. X          break;
  1357. X! # ifdef SEDUCE
  1358. X          case AD_SSEX:
  1359. X! # endif
  1360. X          case AD_SEDU:
  1361. X          case AD_SITM:
  1362. X          if(mdef->minvent) {
  1363. X***************
  1364. X*** 710,718 ****
  1365. X                  kludge("%s finishes taking off his suit.",
  1366. X                              Monnam(mdef));
  1367. X                  You("steal a %s.", xname(stealoid));
  1368. X! #ifdef ARMY
  1369. X                  mdef->data = &mons[PM_UNARMORED_SOLDIER];
  1370. X! #endif
  1371. X              }
  1372. X             } else {
  1373. X                    otmp = mdef->minvent;
  1374. X--- 728,736 ----
  1375. X                  kludge("%s finishes taking off his suit.",
  1376. X                              Monnam(mdef));
  1377. X                  You("steal a %s.", xname(stealoid));
  1378. X! # ifdef ARMY
  1379. X                  mdef->data = &mons[PM_UNARMORED_SOLDIER];
  1380. X! # endif
  1381. X              }
  1382. X             } else {
  1383. X                    otmp = mdef->minvent;
  1384. X***************
  1385. X*** 751,757 ****
  1386. X          break;
  1387. X          case AD_CURS:
  1388. X          if (night() && !rn2(10) && !mdef->mcan) {
  1389. X! #ifdef GOLEMS
  1390. X              if (mdef->data == &mons[PM_CLAY_GOLEM]) {
  1391. X              if (!Blind)
  1392. X                  pline("Some writing vanishes from %s's head!",
  1393. X--- 769,775 ----
  1394. X          break;
  1395. X          case AD_CURS:
  1396. X          if (night() && !rn2(10) && !mdef->mcan) {
  1397. X! # ifdef GOLEMS
  1398. X              if (mdef->data == &mons[PM_CLAY_GOLEM]) {
  1399. X              if (!Blind)
  1400. X                  pline("Some writing vanishes from %s's head!",
  1401. X***************
  1402. X*** 759,765 ****
  1403. X              xkilled(mdef, 0);
  1404. X              return 2;
  1405. X                }
  1406. X! #endif /* GOLEMS */
  1407. X              mdef->mcan = 1;
  1408. X              You("chuckle.");
  1409. X          }
  1410. X--- 777,783 ----
  1411. X              xkilled(mdef, 0);
  1412. X              return 2;
  1413. X                }
  1414. X! # endif /* GOLEMS */
  1415. X              mdef->mcan = 1;
  1416. X              You("chuckle.");
  1417. X          }
  1418. X***************
  1419. X*** 779,795 ****
  1420. X          tmp = 0;
  1421. X          break;
  1422. X          case AD_RUST:
  1423. X! #ifdef GOLEMS
  1424. X          if (pd == &mons[PM_IRON_GOLEM]) {
  1425. X              kludge("%s falls to pieces!", Monnam(mdef));
  1426. X              xkilled(mdef,0);
  1427. X              return(2);
  1428. X          }
  1429. X! #endif /* GOLEMS */
  1430. X          tmp = 0;
  1431. X          break;
  1432. X          case AD_DCAY:
  1433. X! #ifdef GOLEMS
  1434. X          if (pd == &mons[PM_WOOD_GOLEM] ||
  1435. X              pd == &mons[PM_LEATHER_GOLEM]) {
  1436. X              kludge("%s falls to pieces!", Monnam(mdef));
  1437. X--- 797,813 ----
  1438. X          tmp = 0;
  1439. X          break;
  1440. X          case AD_RUST:
  1441. X! # ifdef GOLEMS
  1442. X          if (pd == &mons[PM_IRON_GOLEM]) {
  1443. X              kludge("%s falls to pieces!", Monnam(mdef));
  1444. X              xkilled(mdef,0);
  1445. X              return(2);
  1446. X          }
  1447. X! # endif /* GOLEMS */
  1448. X          tmp = 0;
  1449. X          break;
  1450. X          case AD_DCAY:
  1451. X! # ifdef GOLEMS
  1452. X          if (pd == &mons[PM_WOOD_GOLEM] ||
  1453. X              pd == &mons[PM_LEATHER_GOLEM]) {
  1454. X              kludge("%s falls to pieces!", Monnam(mdef));
  1455. X***************
  1456. X*** 796,802 ****
  1457. X              xkilled(mdef,0);
  1458. X              return(2);
  1459. X          }
  1460. X! #endif /* GOLEMS */
  1461. X          case AD_DRST:
  1462. X          case AD_DRDX:
  1463. X          case AD_DRCO:
  1464. X--- 814,820 ----
  1465. X              xkilled(mdef,0);
  1466. X              return(2);
  1467. X          }
  1468. X! # endif /* GOLEMS */
  1469. X          case AD_DRST:
  1470. X          case AD_DRDX:
  1471. X          case AD_DRCO:
  1472. X***************
  1473. X*** 827,833 ****
  1474. X      if((mdef->mhp -= tmp) < 1) {
  1475. X  
  1476. X          if(mdef->mtame) {
  1477. X!         if(!Blind) You("killed your %s!", mon_nam(mdef));
  1478. X          else    You("feel embarrassed for a moment.");
  1479. X          } else {
  1480. X          if(!Blind && flags.verbose)  pline("%s is killed!", Monnam(mdef));
  1481. X--- 845,851 ----
  1482. X      if((mdef->mhp -= tmp) < 1) {
  1483. X  
  1484. X          if(mdef->mtame) {
  1485. X!         if(!Blind) You("killed your %s!", lmonnam(mdef) + 4);
  1486. X          else    You("feel embarrassed for a moment.");
  1487. X          } else {
  1488. X          if(!Blind && flags.verbose)  pline("%s is killed!", Monnam(mdef));
  1489. X***************
  1490. X*** 863,873 ****
  1491. X               killed(mdef);
  1492. X               return(2);
  1493. X              }
  1494. X! #ifdef GOLEMS
  1495. X          } else if (is_golem(mdef->data)) {
  1496. X              golemeffects(mdef, AD_COLD, d(6,6));
  1497. X              shieldeff(mdef->mx, mdef->my);
  1498. X! #endif /* GOLEMS */
  1499. X          } else {
  1500. X              shieldeff(mdef->mx, mdef->my);
  1501. X              kludge("The blast doesn't seem to affect %s.",
  1502. X--- 881,891 ----
  1503. X               killed(mdef);
  1504. X               return(2);
  1505. X              }
  1506. X! # ifdef GOLEMS
  1507. X          } else if (is_golem(mdef->data)) {
  1508. X              golemeffects(mdef, AD_COLD, d(6,6));
  1509. X              shieldeff(mdef->mx, mdef->my);
  1510. X! # endif /* GOLEMS */
  1511. X          } else {
  1512. X              shieldeff(mdef->mx, mdef->my);
  1513. X              kludge("The blast doesn't seem to affect %s.",
  1514. X***************
  1515. X*** 894,910 ****
  1516. X       * after exactly 1 round of attack otherwise.  -KAA
  1517. X       */
  1518. X  
  1519. X! #ifdef WORM
  1520. X      if(mdef->wormno) return 0;
  1521. X! #endif
  1522. X      if(u.uhunger < 1500 && !u.uswallow) {
  1523. X  
  1524. X          if(mdef->data->mlet != S_COCKATRICE) {
  1525. X! #ifdef LINT    /* static char msgbuf[BUFSZ]; */
  1526. X          char msgbuf[BUFSZ];
  1527. X! #else
  1528. X          static char msgbuf[BUFSZ];
  1529. X! #endif
  1530. X  /* TODO: get the symbol display also to work (monster symbol is removed from
  1531. X   * the screen and you moved onto it, then you get moved back and it gets
  1532. X   * moved back if the monster survives--just like when monsters swallow you.
  1533. X--- 912,928 ----
  1534. X       * after exactly 1 round of attack otherwise.  -KAA
  1535. X       */
  1536. X  
  1537. X! # ifdef WORM
  1538. X      if(mdef->wormno) return 0;
  1539. X! # endif
  1540. X      if(u.uhunger < 1500 && !u.uswallow) {
  1541. X  
  1542. X          if(mdef->data->mlet != S_COCKATRICE) {
  1543. X! # ifdef LINT    /* static char msgbuf[BUFSZ]; */
  1544. X          char msgbuf[BUFSZ];
  1545. X! # else
  1546. X          static char msgbuf[BUFSZ];
  1547. X! # endif
  1548. X  /* TODO: get the symbol display also to work (monster symbol is removed from
  1549. X   * the screen and you moved onto it, then you get moved back and it gets
  1550. X   * moved back if the monster survives--just like when monsters swallow you.
  1551. X***************
  1552. X*** 949,957 ****
  1553. X                  kludge("%s seems unhurt.", Monnam(mdef));
  1554. X                  dam = 0;
  1555. X                  }
  1556. X! #ifdef GOLEMS
  1557. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1558. X! #endif
  1559. X              } else dam = 0;
  1560. X              break;
  1561. X              case AD_COLD:
  1562. X--- 967,975 ----
  1563. X                  kludge("%s seems unhurt.", Monnam(mdef));
  1564. X                  dam = 0;
  1565. X                  }
  1566. X! # ifdef GOLEMS
  1567. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1568. X! # endif
  1569. X              } else dam = 0;
  1570. X              break;
  1571. X              case AD_COLD:
  1572. X***************
  1573. X*** 961,969 ****
  1574. X                  dam = 0;
  1575. X                  } else
  1576. X                  kludge("%s is freezing to death!",Monnam(mdef));
  1577. X! #ifdef GOLEMS
  1578. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1579. X! #endif
  1580. X              } else dam = 0;
  1581. X              break;
  1582. X              case AD_FIRE:
  1583. X--- 979,987 ----
  1584. X                  dam = 0;
  1585. X                  } else
  1586. X                  kludge("%s is freezing to death!",Monnam(mdef));
  1587. X! # ifdef GOLEMS
  1588. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1589. X! # endif
  1590. X              } else dam = 0;
  1591. X              break;
  1592. X              case AD_FIRE:
  1593. X***************
  1594. X*** 973,981 ****
  1595. X                  dam = 0;
  1596. X                  } else
  1597. X                  kludge("%s is burning to a crisp!",Monnam(mdef));
  1598. X! #ifdef GOLEMS
  1599. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1600. X! #endif
  1601. X              } else dam = 0;
  1602. X              break;
  1603. X          }
  1604. X--- 991,999 ----
  1605. X                  dam = 0;
  1606. X                  } else
  1607. X                  kludge("%s is burning to a crisp!",Monnam(mdef));
  1608. X! # ifdef GOLEMS
  1609. X                  golemeffects(mdef,(int)mattk->adtyp,dam);
  1610. X! # endif
  1611. X              } else dam = 0;
  1612. X              break;
  1613. X          }
  1614. X***************
  1615. X*** 994,1022 ****
  1616. X          kludge("You bite into %s", mon_nam(mdef));
  1617. X          You("turn to stone...");
  1618. X          killer = "poor choice of food";
  1619. X!         done("stoned");
  1620. X          }
  1621. X      }
  1622. X      return(0);
  1623. X  }
  1624. X  
  1625. X! static void
  1626. X! missum(mdef)
  1627. X  register struct monst *mdef;
  1628. X  {
  1629. X! #ifdef POLYSELF
  1630. X!     if (u.usym==S_NYMPH
  1631. X! #  ifdef SEDUCE
  1632. X! || ((u.umonnum==PM_INCUBUS || u.umonnum==PM_SUCCUBUS) && !incompatible(mdef))
  1633. X! #  endif
  1634. X!                                     )
  1635. X          kludge("You pretend to be friendly to %s.", mon_nam(mdef));
  1636. X      else
  1637. X! #endif
  1638. X!     if(!Blind && flags.verbose)  You("miss %s.", mon_nam(mdef));
  1639. X!     else        You("miss it.");
  1640. X!     if(is_human(mdef->data) && !(mdef->msleep || mdef->mfroz))
  1641. X!         wakeup(mdef);
  1642. X  }
  1643. X  
  1644. X  static boolean
  1645. X--- 1012,1035 ----
  1646. X          kludge("You bite into %s", mon_nam(mdef));
  1647. X          You("turn to stone...");
  1648. X          killer = "poor choice of food";
  1649. X!         done(STONING);
  1650. X          }
  1651. X      }
  1652. X      return(0);
  1653. X  }
  1654. X  
  1655. X! void
  1656. X! missum(mdef,mattk)
  1657. X  register struct monst *mdef;
  1658. X+ register struct attack *mattk;
  1659. X  {
  1660. X!     if (could_seduce(&youmonst, mdef, mattk))
  1661. X          kludge("You pretend to be friendly to %s.", mon_nam(mdef));
  1662. X+     else if(!Blind && flags.verbose)
  1663. X+         You("miss %s.", mon_nam(mdef));
  1664. X      else
  1665. X!         You("miss it.");
  1666. X!     wakeup(mdef);
  1667. X  }
  1668. X  
  1669. X  static boolean
  1670. X***************
  1671. X*** 1031,1036 ****
  1672. X--- 1044,1050 ----
  1673. X  
  1674. X      for(i = 0; i < NATTK; i++) {
  1675. X  
  1676. X+         sum[i] = 0;
  1677. X          mattk = &(uasmon->mattk[i]);
  1678. X          switch(mattk->aatyp) {
  1679. X          case AT_WEAP:
  1680. X***************
  1681. X*** 1054,1082 ****
  1682. X              if (dhit && mattk->adtyp != AD_SPEL
  1683. X                  && mattk->adtyp != AD_PHYS)
  1684. X                  sum[i] = damageum(mon,mattk);
  1685. X-             else sum[i] = 0;
  1686. X              break;
  1687. X          case AT_CLAW:
  1688. X              if (i==0 && uwep && humanoid(uasmon)) goto use_weapon;
  1689. X          case AT_KICK:
  1690. X          case AT_BITE:
  1691. X          case AT_STNG:
  1692. X          case AT_TUCH:
  1693. X          case AT_BUTT:
  1694. X!             if (i==0 && uwep && (u.usym==S_LICH
  1695. X!                 )) goto use_weapon;
  1696. X              if(dhit = (tmp > rnd(20) || u.uswallow)) {
  1697. X! /* <----- <----- <----- <----- <----- <----- <----- <----- <----- */
  1698. X! if (!u.uswallow && (u.usym==S_NYMPH
  1699. X! #ifdef SEDUCE
  1700. X!   || ((u.umonnum==PM_INCUBUS || u.umonnum==PM_SUCCUBUS) && !incompatible(mon))
  1701. X! #endif
  1702. X!                                     )) {
  1703. X!         kludge("You %s %s %s.", mon->mblinded ? "talk to" : "smile at",
  1704. X!             mon_nam(mon),
  1705. X!             incompatible(mon) ? "engagingly" : "seductively");
  1706. X! }
  1707. X! /* <----- <----- <----- <----- <----- <----- <----- <----- <----- */
  1708. X                  else if (mattk->aatyp == AT_KICK)
  1709. X                      kludge("You kick %s.", mon_nam(mon));
  1710. X                  else if (mattk->aatyp == AT_BITE)
  1711. X--- 1068,1099 ----
  1712. X              if (dhit && mattk->adtyp != AD_SPEL
  1713. X                  && mattk->adtyp != AD_PHYS)
  1714. X                  sum[i] = damageum(mon,mattk);
  1715. X              break;
  1716. X          case AT_CLAW:
  1717. X              if (i==0 && uwep && humanoid(uasmon)) goto use_weapon;
  1718. X+ # ifdef SEDUCE
  1719. X+             /* succubi/incubi are humanoid, but their _second_
  1720. X+              * attack is AT_CLAW, not their first...
  1721. X+              */
  1722. X+             if (i==1 && uwep && (u.umonnum == PM_SUCCUBUS ||
  1723. X+                 u.umonnum == PM_INCUBUS)) goto use_weapon;
  1724. X+ # endif
  1725. X          case AT_KICK:
  1726. X          case AT_BITE:
  1727. X          case AT_STNG:
  1728. X          case AT_TUCH:
  1729. X          case AT_BUTT:
  1730. X!             if (i==0 && uwep && (u.usym==S_LICH)) goto use_weapon;
  1731. X              if(dhit = (tmp > rnd(20) || u.uswallow)) {
  1732. X!                 int compat;
  1733. X! 
  1734. X!                 if (!u.uswallow &&
  1735. X!                     (compat = could_seduce(&youmonst,
  1736. X!                                 mon, mattk)))
  1737. X!                 pline("You %s %s %s.",
  1738. X!                     mon->mblinded ? "talk to" : "smile at",
  1739. X!                     Blind ? "it" : mon_nam(mon),
  1740. X!                     compat == 2 ? "engagingly" : "seductively");
  1741. X                  else if (mattk->aatyp == AT_KICK)
  1742. X                      kludge("You kick %s.", mon_nam(mon));
  1743. X                  else if (mattk->aatyp == AT_BITE)
  1744. X***************
  1745. X*** 1089,1098 ****
  1746. X                      kludge("You touch %s.", mon_nam(mon));
  1747. X                  else kludge("You hit %s.", mon_nam(mon));
  1748. X                  sum[i] = damageum(mon, mattk);
  1749. X!             } else {
  1750. X!                 missum(mon);
  1751. X!                 sum[i] = 0;
  1752. X!             }
  1753. X              break;
  1754. X  
  1755. X          case AT_HUGS:
  1756. X--- 1106,1113 ----
  1757. X                      kludge("You touch %s.", mon_nam(mon));
  1758. X                  else kludge("You hit %s.", mon_nam(mon));
  1759. X                  sum[i] = damageum(mon, mattk);
  1760. X!             } else
  1761. X!                 missum(mon, mattk);
  1762. X              break;
  1763. X  
  1764. X          case AT_HUGS:
  1765. X***************
  1766. X*** 1100,1118 ****
  1767. X               * already grabbed in a previous attack
  1768. X               */
  1769. X              dhit = 1;
  1770. X!             if (sticks(mon->data)) sum[i] = 0;
  1771. X!             else if (mon==u.ustuck) {
  1772. X!                 kludge("%s is being %s.", Monnam(mon),
  1773. X! #ifdef GOLEMS
  1774. X!                 u.umonnum==PM_ROPE_GOLEM ? "choked":
  1775. X! #endif
  1776. X!                 "crushed");
  1777. X!                 sum[i] = damageum(mon, mattk);
  1778. X!             } else if(sum[i-1] && sum[i-2]) {
  1779. X!                 kludge("You grab %s!", mon_nam(mon));
  1780. X!                 u.ustuck = mon;
  1781. X!                 sum[i] = damageum(mon, mattk);
  1782. X!             } else sum[i] = 0;
  1783. X              break;
  1784. X  
  1785. X          case AT_EXPL:    /* automatic hit if next to */
  1786. X--- 1115,1133 ----
  1787. X               * already grabbed in a previous attack
  1788. X               */
  1789. X              dhit = 1;
  1790. X!             if (!sticks(mon->data))
  1791. X!                 if (mon==u.ustuck) {
  1792. X!                 kludge("%s is being %s.", Monnam(mon),
  1793. X! # ifdef GOLEMS
  1794. X!                     u.umonnum==PM_ROPE_GOLEM ? "choked":
  1795. X! # endif
  1796. X!                     "crushed");
  1797. X!                 sum[i] = damageum(mon, mattk);
  1798. X!                 } else if(sum[i-1] && sum[i-2]) {
  1799. X!                 kludge("You grab %s!", mon_nam(mon));
  1800. X!                 u.ustuck = mon;
  1801. X!                 sum[i] = damageum(mon, mattk);
  1802. X!                 }
  1803. X              break;
  1804. X  
  1805. X          case AT_EXPL:    /* automatic hit if next to */
  1806. X***************
  1807. X*** 1123,1132 ****
  1808. X          case AT_ENGL:
  1809. X              if((dhit = (tmp > rnd(20+i))))
  1810. X                  sum[i]= gulpum(mon,mattk);
  1811. X!             else {
  1812. X!                 missum(mon);
  1813. X!                 sum[i] = 0;
  1814. X!             }
  1815. X              break;
  1816. X  
  1817. X          case AT_MAGC:
  1818. X--- 1138,1145 ----
  1819. X          case AT_ENGL:
  1820. X              if((dhit = (tmp > rnd(20+i))))
  1821. X                  sum[i]= gulpum(mon,mattk);
  1822. X!             else
  1823. X!                 missum(mon, mattk);
  1824. X              break;
  1825. X  
  1826. X          case AT_MAGC:
  1827. X***************
  1828. X*** 1139,1145 ****
  1829. X                  )) goto use_weapon;
  1830. X  
  1831. X          case AT_NONE:
  1832. X-             sum[i] = 0;
  1833. X              continue;
  1834. X              /* Not break--avoid passive attacks from enemy */
  1835. X  
  1836. X--- 1152,1157 ----
  1837. X***************
  1838. X*** 1149,1162 ****
  1839. X          case AT_BREA:
  1840. X          case AT_SPIT:
  1841. X          case AT_GAZE:    /* all done using #monster command */
  1842. X!             sum[i] = dhit = 0;
  1843. X              break;
  1844. X          }
  1845. X          if (dhit == -1)
  1846. X          rehumanize();
  1847. X!         if(sum[i] == 2) return(passive(mon, 1, 0)); /* defender dead */
  1848. X          else {
  1849. X!         (void) passive(mon, sum[i], 1);
  1850. X          nsum |= sum[i];
  1851. X          }
  1852. X          if (uasmon == &playermon)
  1853. X--- 1161,1175 ----
  1854. X          case AT_BREA:
  1855. X          case AT_SPIT:
  1856. X          case AT_GAZE:    /* all done using #monster command */
  1857. X!             dhit = 0;
  1858. X              break;
  1859. X          }
  1860. X          if (dhit == -1)
  1861. X          rehumanize();
  1862. X!         if(sum[i] == 2) return(passive(mon, 1, 0, (mattk->aatyp==AT_KICK)));
  1863. X!                             /* defender dead */
  1864. X          else {
  1865. X!         (void) passive(mon, sum[i], 1, (mattk->aatyp==AT_KICK));
  1866. X          nsum |= sum[i];
  1867. X          }
  1868. X          if (uasmon == &playermon)
  1869. X***************
  1870. X*** 1167,1181 ****
  1871. X      return(nsum);
  1872. X  }
  1873. X  
  1874. X! #endif
  1875. X  
  1876. X  /*    Special (passive) attacks on you by monsters done here.        */
  1877. X  
  1878. X  int
  1879. X! passive(mon, mhit, malive)
  1880. X  register struct monst *mon;
  1881. X  register boolean mhit;
  1882. X  register int malive;
  1883. X  {
  1884. X      register struct permonst *ptr = mon->data;
  1885. X      register int i, tmp;
  1886. X--- 1180,1195 ----
  1887. X      return(nsum);
  1888. X  }
  1889. X  
  1890. X! #endif /* POLYSELF */
  1891. X  
  1892. X  /*    Special (passive) attacks on you by monsters done here.        */
  1893. X  
  1894. X  int
  1895. X! passive(mon, mhit, malive, kicked)
  1896. X  register struct monst *mon;
  1897. X  register boolean mhit;
  1898. X  register int malive;
  1899. X+ boolean kicked;
  1900. X  {
  1901. X      register struct permonst *ptr = mon->data;
  1902. X      register int i, tmp;
  1903. X***************
  1904. X*** 1201,1207 ****
  1905. X              mdamageu(mon, tmp);
  1906. X          if(!rn2(30)) corrode_armor();
  1907. X          }
  1908. X!         if(mhit && !rn2(6)) corrode_weapon();
  1909. X          break;
  1910. X        case AD_MAGM:
  1911. X          /* wrath of gods for attacking Oracle */
  1912. X--- 1215,1226 ----
  1913. X              mdamageu(mon, tmp);
  1914. X          if(!rn2(30)) corrode_armor();
  1915. X          }
  1916. X!         if(mhit && !rn2(6)) {
  1917. X!         if (kicked) {
  1918. X!             if (uarmf)
  1919. X!             (void) rust_dmg(uarmf, xname(uarmf), 1, TRUE);
  1920. X!         } else corrode_weapon();
  1921. X!         }
  1922. X          break;
  1923. X        case AD_MAGM:
  1924. X          /* wrath of gods for attacking Oracle */
  1925. X***************
  1926. X*** 1306,1309 ****
  1927. X--- 1325,1357 ----
  1928. X          }
  1929. X      }
  1930. X      return(malive | mhit);
  1931. X+ }
  1932. X+ 
  1933. X+ /* Note: caller must ascertain mtmp->mimic... */
  1934. X+ void
  1935. X+ stumble_onto_mimic(mtmp)
  1936. X+ register struct monst *mtmp;
  1937. X+ {
  1938. X+     if(!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data,AD_STCK))
  1939. X+         u.ustuck = mtmp;
  1940. X+     if (Blind) goto generic;
  1941. X+     else if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == DOOR_SYM)
  1942. X+ #ifdef SPELLS
  1943. X+     {
  1944. X+         if (IS_ROCK(levl[u.ux+u.dx][u.uy+u.dy].typ) ||
  1945. X+             IS_DOOR(levl[u.ux+u.dx][u.uy+u.dy].typ))
  1946. X+ #endif
  1947. X+             pline("The door actually was %s.", defmonnam(mtmp));
  1948. X+ #ifdef SPELLS
  1949. X+         else
  1950. X+             pline("That spellbook was %s.", defmonnam(mtmp));
  1951. X+     }
  1952. X+ #endif
  1953. X+     else if (levl[u.ux+u.dx][u.uy+u.dy].scrsym == GOLD_SYM)
  1954. X+         pline("That gold was %s!", defmonnam(mtmp));
  1955. X+     else {
  1956. X+ generic:
  1957. X+         pline("Wait!  That's %s!", defmonnam(mtmp));
  1958. X+     }
  1959. X+     wakeup(mtmp);    /* clears mtmp->mimic */
  1960. X  }
  1961. X*** src/Old/unixmain.c    Wed Aug 16 12:48:29 1989
  1962. X--- src/unixmain.c    Tue Aug 15 22:05:14 1989
  1963. X***************
  1964. X*** 67,74 ****
  1965. X      }
  1966. X  #endif /* CHDIR /**/
  1967. X      /* Set the default values of the presentation characters */
  1968. X!     (void) memcpy((char *) &showsyms, 
  1969. X!         (char *) &defsyms, sizeof(struct symbols));
  1970. X      initoptions();
  1971. X      whoami();
  1972. X      /*
  1973. X--- 67,74 ----
  1974. X      }
  1975. X  #endif /* CHDIR /**/
  1976. X      /* Set the default values of the presentation characters */
  1977. X!     (void) memcpy((genericptr_t) &showsyms,
  1978. X!         (genericptr_t) &defsyms, sizeof(struct symbols));
  1979. X      initoptions();
  1980. X      whoami();
  1981. X      /*
  1982. X***************
  1983. X*** 240,247 ****
  1984. X          /* get shopkeeper set properly if restore is in shop */
  1985. X          (void) inshop();
  1986. X  #ifdef EXPLORE_MODE
  1987. X!         if (discover) {
  1988. X              You("are in non-scoring discovery mode.");
  1989. X              pline("Do you want to keep the save file? ");
  1990. X              if(yn() == 'n')
  1991. X                  (void) unlink(SAVEF);
  1992. X--- 240,250 ----
  1993. X          /* get shopkeeper set properly if restore is in shop */
  1994. X          (void) inshop();
  1995. X  #ifdef EXPLORE_MODE
  1996. X!         if (discover)
  1997. X              You("are in non-scoring discovery mode.");
  1998. X+ #endif
  1999. X+ #if defined(EXPLORE_MODE) || defined(WIZARD)
  2000. X+         if (discover || wizard) {
  2001. X              pline("Do you want to keep the save file? ");
  2002. X              if(yn() == 'n')
  2003. X                  (void) unlink(SAVEF);
  2004. X***************
  2005. X*** 305,311 ****
  2006. X  #endif
  2007. X                  if(u.uhp < 1) {
  2008. X                  You("die...");
  2009. X!                 done("died");
  2010. X                  }
  2011. X  #ifdef POLYSELF
  2012. X              if (u.mtimedone) {
  2013. X--- 308,314 ----
  2014. X  #endif
  2015. X                  if(u.uhp < 1) {
  2016. X                  You("die...");
  2017. X!                 done(DIED);
  2018. X                  }
  2019. X  #ifdef POLYSELF
  2020. X              if (u.mtimedone) {
  2021. X*** src/Old/unixtty.c    Wed Aug 16 12:48:50 1989
  2022. X--- src/unixtty.c    Tue Aug 15 22:59:01 1989
  2023. X***************
  2024. X*** 37,42 ****
  2025. X--- 37,44 ----
  2026. X  #define CBRKMASK    ICANON
  2027. X  #define CBRKON        ! /* reverse condition */
  2028. X  #define OSPEED(x)    ((x).c_cflag & CBAUD)
  2029. X+ #define inputflags    c_iflag
  2030. X+ #define STRIPHI        ISTRIP
  2031. X  #define GTTY(x)        (ioctl(0, TCGETA, x))
  2032. X  /* STTY now modified to run under Sys V R3.    - may have to be #ifdef'ed */
  2033. X  #define STTY(x)        (ioctl(0, TCSETAW, x))    /* TCSETAF? TCSETAW? */
  2034. X***************
  2035. X*** 59,64 ****
  2036. X--- 61,68 ----
  2037. X  #define cbrkflgs    sg_flags
  2038. X  #define CBRKMASK    CBREAK
  2039. X  #define CBRKON        /* empty */
  2040. X+ #define inputflags    sg_flags    /* don't know how enabling meta bits */
  2041. X+ #define STRIPHI        0        /* should actually be done on BSD */
  2042. X  #define OSPEED(x)    (x).sg_ospeed
  2043. X  #define GTTY(x)        (gtty(0, x))
  2044. X  #define STTY(x)        (stty(0, x))
  2045. X***************
  2046. X*** 118,123 ****
  2047. X--- 122,128 ----
  2048. X          perror("NetHack (settty)");
  2049. X      flags.echo = (inittyb.echoflgs & ECHO) ? ON : OFF;
  2050. X      flags.cbreak = (CBRKON(inittyb.cbrkflgs & CBRKMASK)) ? ON : OFF;
  2051. X+     curttyb.inputflags |= STRIPHI;
  2052. X      setioctls();
  2053. X  }
  2054. X  
  2055. X***************
  2056. X*** 148,153 ****
  2057. X--- 153,159 ----
  2058. X  #endif
  2059. X          change++;
  2060. X      }
  2061. X+     curttyb.inputflags &=~ STRIPHI;
  2062. X      /* If an interrupt character is used, it will be overriden and
  2063. X       * set to ^C.
  2064. X       */
  2065. X*** src/Old/unixunix.c    Wed Aug 16 12:49:07 1989
  2066. X--- src/unixunix.c    Tue Aug  1 20:39:25 1989
  2067. X***************
  2068. X*** 331,342 ****
  2069. X      /* avoid problems with 14 character file name limit */
  2070. X  # ifdef COMPRESS
  2071. X      if(strlen(s) > 10)
  2072. X!         /* leave room for .e from error and .Z from compress */
  2073. X          s[10] = '\0';
  2074. X  # else
  2075. X!     if(strlen(s) > 12)
  2076. X!         /* leave room for .e from error */
  2077. X!         s[12] = '\0';
  2078. X  # endif
  2079. X  #endif
  2080. X  }
  2081. X--- 331,343 ----
  2082. X      /* avoid problems with 14 character file name limit */
  2083. X  # ifdef COMPRESS
  2084. X      if(strlen(s) > 10)
  2085. X!         /* leave room for .e from error and .Z from compress
  2086. X!          * appended to save files */
  2087. X          s[10] = '\0';
  2088. X  # else
  2089. X!     if(strlen(s) > 11)
  2090. X!         /* leave room for .nn appended to level files */
  2091. X!         s[11] = '\0';
  2092. X  # endif
  2093. X  #endif
  2094. X  }
  2095. END_OF_FILE
  2096. if test 54146 -ne `wc -c <'patch02d'`; then
  2097.     echo shar: \"'patch02d'\" unpacked with wrong size!
  2098. fi
  2099. # end of 'patch02d'
  2100. fi
  2101. echo shar: End of archive 4 \(of 7\).
  2102. cp /dev/null ark4isdone
  2103. MISSING=""
  2104. for I in 1 2 3 4 5 6 7 ; do
  2105.     if test ! -f ark${I}isdone ; then
  2106.     MISSING="${MISSING} ${I}"
  2107.     fi
  2108. done
  2109. if test "${MISSING}" = "" ; then
  2110.     echo You have unpacked all 7 archives.
  2111.     rm -f ark[1-9]isdone
  2112. else
  2113.     echo You still need to unpack the following archives:
  2114.     echo "        " ${MISSING}
  2115. fi
  2116. ##  End of shell archive.
  2117. exit 0
  2118.